// twl_shell.h
#ifndef __TWL_SHELL
#define __TWL_SHELL
#include "threads.h"

class TShell: public Thread {
protected:
	Handle m_stdin_rd,m_stdin_wr,m_stdout_wr,m_stdout_rd,
		    m_stdin_rd_dup,m_stdout_wr_dup,m_stdout_rd_dup,m_stdin_wr_dup;
	int m_process_id;
public:
	TShell();
	~TShell();
	char *create(char *program);
	int create_child_process(char *program);
	int write(char *str);
	// override Thread::execute()
	int execute();

	// derived class can override this!
	virtual void on_read(char *str);
};

#endif